package kgame5.pbe.atlantic.helper {

	/**
	 * @author max
	 * 2011-1-26
	 * 读取外部xml配置文件，供viewComp和fsmBatchComp使用
	 */
	public class PBEConfig {
		
		public static var configXML:XML;
		
		public static function fill(p_configXML:XML):void{
			configXML=p_configXML;
		}
		
		//取得某个view的assetUrl
		public static function getAssetUrl(viewID:String):String{
			return configXML.views..view.(@id==viewID).@url;
		}
		
		//取得某个view的一个外观的信息
		public static function getFormXML(viewID:String,formID:int):XML{
			return configXML.views..view.(@id==viewID)[0].form.(@id==formID)[0];
		}
		
		//
		public static function getFSMXML(fsmID:String):XML{
			return configXML.fsms.fsm.(@id==fsmID)[0];
		}
		
	}//end of class
}
/*
var configXML:XML=
				<root>
					<views>
						<view id="58" url="assets/game/fishs/KillerWhalePink.swf">
				          <form id="0" scale="0.6">
				          	<anim id="Normal" linkage_id="Swim58" looping="1"/>
				          	<anim id="Turn" linkage_id="Turn58" looping="0"/>
				          	<anim id="Eat" linkage_id="Eat58" looping="0"/>
				          </form>
				          <form id="1" scale="0.6">
				          	<anim id="Normal" linkage_id="Swim58" looping="1"/>
				          	<anim id="Turn" linkage_id="Turn58" looping="0"/>
				          	<anim id="Eat" linkage_id="Eat58" looping="0"/>
				          </form>
				          <form id="2" scale="0.6">
				          	<anim id="Normal" linkage_id="Swim58" looping="1"/>
				          	<anim id="Turn" linkage_id="Turn58" looping="0"/>
				          	<anim id="Eat" linkage_id="Eat58" looping="0"/>
				          </form>
				          <form id="3" scale="0.6">
				          	<anim id="Normal" linkage_id="Swim58" looping="1"/>
				          	<anim id="Turn" linkage_id="Turn58" looping="0"/>
				          	<anim id="Eat" linkage_id="Eat58" looping="0"/>
				          </form>
				          <form id="4" scale="0.6">
				          	<anim id="Normal" linkage_id="Swim58" looping="1"/>
				          	<anim id="Turn" linkage_id="Turn58" looping="0"/>
				          	<anim id="Eat" linkage_id="Eat58" looping="0"/>
				          </form>
				        </view>
				        <view id="57" url="assets/game/fishs/KillerWhalePink.swf">
				          <form id="0" scale="0.6">
				          	<anim id="Normal" linkage_id="Swim58" looping="1"/>
				          	<anim id="Turn" linkage_id="Turn58" looping="0"/>
				          	<anim id="Eat" linkage_id="Eat58" looping="0"/>
				          </form>
				          <form id="1" scale="0.6">
				          	<anim id="Normal" linkage_id="Swim58" looping="1"/>
				          	<anim id="Turn" linkage_id="Turn58" looping="0"/>
				          	<anim id="Eat" linkage_id="Eat58" looping="0"/>
				          </form>
				          <form id="2" scale="0.6">
				          	<anim id="Normal" linkage_id="Swim58" looping="1"/>
				          	<anim id="Turn" linkage_id="Turn58" looping="0"/>
				          	<anim id="Eat" linkage_id="Eat58" looping="0"/>
				          </form>
				          <form id="3" scale="0.6">
				          	<anim id="Normal" linkage_id="Swim58" looping="1"/>
				          	<anim id="Turn" linkage_id="Turn58" looping="0"/>
				          	<anim id="Eat" linkage_id="Eat58" looping="0"/>
				          </form>
				          <form id="4" scale="0.6">
				          	<anim id="Normal" linkage_id="Swim58" looping="1"/>
				          	<anim id="Turn" linkage_id="Turn58" looping="0"/>
				          	<anim id="Eat" linkage_id="Eat58" looping="0"/>
				          </form>
				        </view>
			        </views>
			        <fsms>
						<fsm id="MOVE">
				          	<state id="WANDER" calzz="com.twofish.fishbowl.game2.core.fish.state.WanderStateV2"/>
				          	<state id="TURNING" calzz="com.twofish.fishbowl.game2.core.fish.state.TurningStateV2"/>
						</fsm>
			        </fsms>
				</root>;
//*/